
const http = require("http");
const io = require("socket.io");

//1.创建http的服务
let httpServer = http.createServer();
httpServer.listen(8080);

//2.创建webSocket服务
let wsServer = io.listen(httpServer);

wsServer.on("connection",function (sock) {
	sock.on('cc',function (num1,num2) {
		console.log("接到了浏览器发送的数据",num1,num2);
		sock.emit('ttt',num1,num2);
	});
	

});
